package com.hf.controller;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hf.util.Result;

public class GlobalExceptionHandler {

	@ResponseBody
	@ExceptionHandler(Exception.class) // 捕获所有运行时异常
	public Object exceptionHandler(Exception e) {
		return new Result(500, e.getMessage());
	}

}
